<!DOCTYPE html>
<html>
<head>
	<?php
	include "connection-provider.php";
?>
</head>
<body>
<a href="select-question-type-admin.php">Add Question</a>


<div style="width:960px; margin:0 auto;">
	<fieldset><h3>Student Details</h3>
		<table border='1'>
			<tr>
				<th>Name</th>
				<th>Roll No.</th>
				<th>Gender</th>
				<th>Email</th>
				<th>Status</th>		<!-- Submitted or not -->
				<th>Aptitude Marks</th>
				<th>Technical Marks</th>
				<th>Total Marks</th>
				
			</tr>
			
				
<?php
				
					$total_marks = 0;
					$result = mysqli_query($con,"SELECT * FROM login_details");		
					while($row = mysqli_fetch_array($result))
					{	
						$aptitudeMarks=  0;
						echo "<tr><td><a href='show-answer-sheet.php?studentID=$row[userID]'>" . $row['UserName'] . "</a></td>
								<td>" . $row['UserRollNo'] . "</td>
								<td>" . $row['UserGender'] . "</td>
								<td>" . $row['UserEmail'] . "</td>";
								echo "<td></td>";
						$result1 = mysqli_query($con,"SELECT * FROM total_marks_table where student_id='$row[userID]'");		
						while($row = mysqli_fetch_array($result1))
						{									
								
							echo "<td>" . $row['total_marks'] . "</td>";					
							$total_marks = $total_marks + $row['total_marks'];
						}
						echo "<td>" . $total_marks . "</td>";
						echo "</tr>";
					}

?>
				
			
		

		
		</table>	
	</fieldset>



</div>
</body>
</html>